Nathan White wrote:
[...] Realize that you should probably pull the onchange javascript out
and wrap it in a function and do DOM checking first so you don't product
errors in old browsers.
True, however:
<select onchange="document.getElementById('productPic').sr c =
this.options[this.selectedIndex].value;>
Oh my. The `document.images' collection exists:
<select onchange="document.images['productPic'].src =
this.options[this.selectedIndex].value;>
See also <URL:http://pointedears.de/scripts/test/hoverMe/> for a much
less error-prone approach.
<option value="null">-- Please Select Product --</option>
This should not be `null', but refer to a default image. In fact, this
option is nonsensical: The default option should be the one specifying
the initial `src' attribute value of the `img' element.
[...]
</select>
<img id="productPic" src="blank.gif">
Although the `id' attribute should work with `document.images', the `name'
attribute is fully downwards compatible with it to DOM Level 0 (NN3+/IE3+).
PointedEars